

import { axios, get, post, patch, Delete } from './request';

// 解决跨域  (jsonp cors 反向代理 )
// 声明代理对象   这个对象可以代理前端的域名   映射后端的接口地址  



// 所有的接口封装这里  promise (async+await )
// 服务层 提供接口 提供数据
// 反向代理和基路径会有冲突 直接干掉基路径  默认前端的域名 
export const ajax = {
    test: (params) => get("/api/test", params),
    findUser: (params) => get("/api/users", params),
    addUser: (params) => post("/api/users", params),

    // 发送验证码  http://47.104.209.44:3333/
    // sendCaptcha:params=>get('http://47.104.209.44:3333/captcha/sent',params),

    // verifyCaptcha:params=>get('http://47.104.209.44:3333/captcha/verify',params),

    sendCaptcha: params => get('/wangyi/captcha/sent', params),

    verifyCaptcha: params => get('/wangyi/captcha/verify', params),

    // 卖座接口   跨域
    // getMaiData:(params,headers)=>get("https://m.maizuo.com/gateway",params,headers)
    getMaiData: (params, headers) => get("/gateway", params, headers),


    postMaiData: (params, headers) => post("/gateway", params, headers),






}
